package com.seraph.zys.dao.impl;

import com.seraph.bi.suite.support.domain.pagination.PageBox;
import com.seraph.bi.suite.support.domain.pagination.PageObject;
import com.seraph.zys.dao.RptInstanceDAO;
import com.seraph.zys.dao.domain.RptInstance;
import com.seraph.zys.dao.domain.RptInstanceExample;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.springframework.orm.ibatis.support.SqlMapClientDaoSupport;
import org.springframework.stereotype.Repository;

@Repository
public class RptInstanceDAOImpl extends SqlMapClientDaoSupport implements RptInstanceDAO {

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public RptInstanceDAOImpl() {
        super();
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public Double insert(RptInstance record) {
        Object newKey = getSqlMapClientTemplate().insert("rpt_instance.abatorgenerated_insert", record);
        return (Double) newKey;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public int updateByPrimaryKey(RptInstance record) {
        int rows = getSqlMapClientTemplate().update("rpt_instance.abatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public int updateByPrimaryKeySelective(RptInstance record) {
        int rows = getSqlMapClientTemplate().update("rpt_instance.abatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public List selectByExample(RptInstanceExample example, String orderByClause) {
        Map parms = getExampleParms(example);
        if (orderByClause != null) {
            parms.put("ABATOR_ORDER_BY_CLAUSE", orderByClause);
        }
        List list = getSqlMapClientTemplate().queryForList("rpt_instance.abatorgenerated_selectByExample", parms);
        return list;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public List selectByExample(RptInstanceExample example) {
        return selectByExample(example, null);
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public RptInstance selectByPrimaryKey(Double id) {
        RptInstance key = new RptInstance();
        key.setId(id);
        RptInstance record = (RptInstance) getSqlMapClientTemplate().queryForObject("rpt_instance.abatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public int deleteByExample(RptInstanceExample example) {
        int rows = getSqlMapClientTemplate().delete("rpt_instance.abatorgenerated_deleteByExample", getExampleParms(example));
        return rows;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public int deleteByPrimaryKey(Double id) {
        RptInstance key = new RptInstance();
        key.setId(id);
        int rows = getSqlMapClientTemplate().delete("rpt_instance.abatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getIDExampleParms(RptInstanceExample example) {
        Map parms = new HashMap();
        switch (example.getId_Indicator()) {
        case RptInstanceExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ID_NULL", "Y");
            } else {
                parms.put("AND_ID_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ID_NOT_NULL", "Y");
            } else {
                parms.put("AND_ID_NOT_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ID_EQUALS", "Y");
            } else {
                parms.put("AND_ID_EQUALS", "Y");
            }
            parms.put("id", example.getId());
            break;
        case RptInstanceExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ID_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_ID_NOT_EQUALS", "Y");
            }
            parms.put("id", example.getId());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ID_GT", "Y");
            } else {
                parms.put("AND_ID_GT", "Y");
            }
            parms.put("id", example.getId());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ID_GE", "Y");
            } else {
                parms.put("AND_ID_GE", "Y");
            }
            parms.put("id", example.getId());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ID_LT", "Y");
            } else {
                parms.put("AND_ID_LT", "Y");
            }
            parms.put("id", example.getId());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ID_LE", "Y");
            } else {
                parms.put("AND_ID_LE", "Y");
            }
            parms.put("id", example.getId());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getRPT_CODEExampleParms(RptInstanceExample example) {
        Map parms = new HashMap();
        switch (example.getRptCode_Indicator()) {
        case RptInstanceExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_CODE_NULL", "Y");
            } else {
                parms.put("AND_RPT_CODE_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_CODE_NOT_NULL", "Y");
            } else {
                parms.put("AND_RPT_CODE_NOT_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_CODE_EQUALS", "Y");
            } else {
                parms.put("AND_RPT_CODE_EQUALS", "Y");
            }
            parms.put("rptCode", example.getRptCode());
            break;
        case RptInstanceExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_CODE_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_RPT_CODE_NOT_EQUALS", "Y");
            }
            parms.put("rptCode", example.getRptCode());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_CODE_GT", "Y");
            } else {
                parms.put("AND_RPT_CODE_GT", "Y");
            }
            parms.put("rptCode", example.getRptCode());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_CODE_GE", "Y");
            } else {
                parms.put("AND_RPT_CODE_GE", "Y");
            }
            parms.put("rptCode", example.getRptCode());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_CODE_LT", "Y");
            } else {
                parms.put("AND_RPT_CODE_LT", "Y");
            }
            parms.put("rptCode", example.getRptCode());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_CODE_LE", "Y");
            } else {
                parms.put("AND_RPT_CODE_LE", "Y");
            }
            parms.put("rptCode", example.getRptCode());
            break;
        case RptInstanceExample.EXAMPLE_LIKE:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_CODE_LIKE", "Y");
            } else {
                parms.put("AND_RPT_CODE_LIKE", "Y");
            }
            parms.put("rptCode", example.getRptCode());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getORG_CODEExampleParms(RptInstanceExample example) {
        Map parms = new HashMap();
        switch (example.getOrgCode_Indicator()) {
        case RptInstanceExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ORG_CODE_NULL", "Y");
            } else {
                parms.put("AND_ORG_CODE_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ORG_CODE_NOT_NULL", "Y");
            } else {
                parms.put("AND_ORG_CODE_NOT_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ORG_CODE_EQUALS", "Y");
            } else {
                parms.put("AND_ORG_CODE_EQUALS", "Y");
            }
            parms.put("orgCode", example.getOrgCode());
            break;
        case RptInstanceExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ORG_CODE_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_ORG_CODE_NOT_EQUALS", "Y");
            }
            parms.put("orgCode", example.getOrgCode());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ORG_CODE_GT", "Y");
            } else {
                parms.put("AND_ORG_CODE_GT", "Y");
            }
            parms.put("orgCode", example.getOrgCode());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ORG_CODE_GE", "Y");
            } else {
                parms.put("AND_ORG_CODE_GE", "Y");
            }
            parms.put("orgCode", example.getOrgCode());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ORG_CODE_LT", "Y");
            } else {
                parms.put("AND_ORG_CODE_LT", "Y");
            }
            parms.put("orgCode", example.getOrgCode());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ORG_CODE_LE", "Y");
            } else {
                parms.put("AND_ORG_CODE_LE", "Y");
            }
            parms.put("orgCode", example.getOrgCode());
            break;
        case RptInstanceExample.EXAMPLE_LIKE:
            if (example.isCombineTypeOr()) {
                parms.put("OR_ORG_CODE_LIKE", "Y");
            } else {
                parms.put("AND_ORG_CODE_LIKE", "Y");
            }
            parms.put("orgCode", example.getOrgCode());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getRPT_DATEExampleParms(RptInstanceExample example) {
        Map parms = new HashMap();
        switch (example.getRptDate_Indicator()) {
        case RptInstanceExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_DATE_NULL", "Y");
            } else {
                parms.put("AND_RPT_DATE_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_DATE_NOT_NULL", "Y");
            } else {
                parms.put("AND_RPT_DATE_NOT_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_DATE_EQUALS", "Y");
            } else {
                parms.put("AND_RPT_DATE_EQUALS", "Y");
            }
            parms.put("rptDate", example.getRptDate());
            break;
        case RptInstanceExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_DATE_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_RPT_DATE_NOT_EQUALS", "Y");
            }
            parms.put("rptDate", example.getRptDate());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_DATE_GT", "Y");
            } else {
                parms.put("AND_RPT_DATE_GT", "Y");
            }
            parms.put("rptDate", example.getRptDate());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_DATE_GE", "Y");
            } else {
                parms.put("AND_RPT_DATE_GE", "Y");
            }
            parms.put("rptDate", example.getRptDate());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_DATE_LT", "Y");
            } else {
                parms.put("AND_RPT_DATE_LT", "Y");
            }
            parms.put("rptDate", example.getRptDate());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_DATE_LE", "Y");
            } else {
                parms.put("AND_RPT_DATE_LE", "Y");
            }
            parms.put("rptDate", example.getRptDate());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getRPT_STATUSExampleParms(RptInstanceExample example) {
        Map parms = new HashMap();
        switch (example.getRptStatus_Indicator()) {
        case RptInstanceExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_STATUS_NULL", "Y");
            } else {
                parms.put("AND_RPT_STATUS_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_STATUS_NOT_NULL", "Y");
            } else {
                parms.put("AND_RPT_STATUS_NOT_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_STATUS_EQUALS", "Y");
            } else {
                parms.put("AND_RPT_STATUS_EQUALS", "Y");
            }
            parms.put("rptStatus", example.getRptStatus());
            break;
        case RptInstanceExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_STATUS_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_RPT_STATUS_NOT_EQUALS", "Y");
            }
            parms.put("rptStatus", example.getRptStatus());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_STATUS_GT", "Y");
            } else {
                parms.put("AND_RPT_STATUS_GT", "Y");
            }
            parms.put("rptStatus", example.getRptStatus());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_STATUS_GE", "Y");
            } else {
                parms.put("AND_RPT_STATUS_GE", "Y");
            }
            parms.put("rptStatus", example.getRptStatus());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_STATUS_LT", "Y");
            } else {
                parms.put("AND_RPT_STATUS_LT", "Y");
            }
            parms.put("rptStatus", example.getRptStatus());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_RPT_STATUS_LE", "Y");
            } else {
                parms.put("AND_RPT_STATUS_LE", "Y");
            }
            parms.put("rptStatus", example.getRptStatus());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getAUDIT_STATUSExampleParms(RptInstanceExample example) {
        Map parms = new HashMap();
        switch (example.getAuditStatus_Indicator()) {
        case RptInstanceExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_STATUS_NULL", "Y");
            } else {
                parms.put("AND_AUDIT_STATUS_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_STATUS_NOT_NULL", "Y");
            } else {
                parms.put("AND_AUDIT_STATUS_NOT_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_STATUS_EQUALS", "Y");
            } else {
                parms.put("AND_AUDIT_STATUS_EQUALS", "Y");
            }
            parms.put("auditStatus", example.getAuditStatus());
            break;
        case RptInstanceExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_STATUS_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_AUDIT_STATUS_NOT_EQUALS", "Y");
            }
            parms.put("auditStatus", example.getAuditStatus());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_STATUS_GT", "Y");
            } else {
                parms.put("AND_AUDIT_STATUS_GT", "Y");
            }
            parms.put("auditStatus", example.getAuditStatus());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_STATUS_GE", "Y");
            } else {
                parms.put("AND_AUDIT_STATUS_GE", "Y");
            }
            parms.put("auditStatus", example.getAuditStatus());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_STATUS_LT", "Y");
            } else {
                parms.put("AND_AUDIT_STATUS_LT", "Y");
            }
            parms.put("auditStatus", example.getAuditStatus());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_STATUS_LE", "Y");
            } else {
                parms.put("AND_AUDIT_STATUS_LE", "Y");
            }
            parms.put("auditStatus", example.getAuditStatus());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getAUDIT_DATEExampleParms(RptInstanceExample example) {
        Map parms = new HashMap();
        switch (example.getAuditDate_Indicator()) {
        case RptInstanceExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_DATE_NULL", "Y");
            } else {
                parms.put("AND_AUDIT_DATE_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_DATE_NOT_NULL", "Y");
            } else {
                parms.put("AND_AUDIT_DATE_NOT_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_DATE_EQUALS", "Y");
            } else {
                parms.put("AND_AUDIT_DATE_EQUALS", "Y");
            }
            parms.put("auditDate", example.getAuditDate());
            break;
        case RptInstanceExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_DATE_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_AUDIT_DATE_NOT_EQUALS", "Y");
            }
            parms.put("auditDate", example.getAuditDate());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_DATE_GT", "Y");
            } else {
                parms.put("AND_AUDIT_DATE_GT", "Y");
            }
            parms.put("auditDate", example.getAuditDate());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_DATE_GE", "Y");
            } else {
                parms.put("AND_AUDIT_DATE_GE", "Y");
            }
            parms.put("auditDate", example.getAuditDate());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_DATE_LT", "Y");
            } else {
                parms.put("AND_AUDIT_DATE_LT", "Y");
            }
            parms.put("auditDate", example.getAuditDate());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_DATE_LE", "Y");
            } else {
                parms.put("AND_AUDIT_DATE_LE", "Y");
            }
            parms.put("auditDate", example.getAuditDate());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getAUDIT_USER_NAMEExampleParms(RptInstanceExample example) {
        Map parms = new HashMap();
        switch (example.getAuditUserName_Indicator()) {
        case RptInstanceExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_USER_NAME_NULL", "Y");
            } else {
                parms.put("AND_AUDIT_USER_NAME_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_USER_NAME_NOT_NULL", "Y");
            } else {
                parms.put("AND_AUDIT_USER_NAME_NOT_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_USER_NAME_EQUALS", "Y");
            } else {
                parms.put("AND_AUDIT_USER_NAME_EQUALS", "Y");
            }
            parms.put("auditUserName", example.getAuditUserName());
            break;
        case RptInstanceExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_USER_NAME_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_AUDIT_USER_NAME_NOT_EQUALS", "Y");
            }
            parms.put("auditUserName", example.getAuditUserName());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_USER_NAME_GT", "Y");
            } else {
                parms.put("AND_AUDIT_USER_NAME_GT", "Y");
            }
            parms.put("auditUserName", example.getAuditUserName());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_USER_NAME_GE", "Y");
            } else {
                parms.put("AND_AUDIT_USER_NAME_GE", "Y");
            }
            parms.put("auditUserName", example.getAuditUserName());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_USER_NAME_LT", "Y");
            } else {
                parms.put("AND_AUDIT_USER_NAME_LT", "Y");
            }
            parms.put("auditUserName", example.getAuditUserName());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_USER_NAME_LE", "Y");
            } else {
                parms.put("AND_AUDIT_USER_NAME_LE", "Y");
            }
            parms.put("auditUserName", example.getAuditUserName());
            break;
        case RptInstanceExample.EXAMPLE_LIKE:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_USER_NAME_LIKE", "Y");
            } else {
                parms.put("AND_AUDIT_USER_NAME_LIKE", "Y");
            }
            parms.put("auditUserName", example.getAuditUserName());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getAUDIT_USER_ALIASExampleParms(RptInstanceExample example) {
        Map parms = new HashMap();
        switch (example.getAuditUserAlias_Indicator()) {
        case RptInstanceExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_USER_ALIAS_NULL", "Y");
            } else {
                parms.put("AND_AUDIT_USER_ALIAS_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_USER_ALIAS_NOT_NULL", "Y");
            } else {
                parms.put("AND_AUDIT_USER_ALIAS_NOT_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_USER_ALIAS_EQUALS", "Y");
            } else {
                parms.put("AND_AUDIT_USER_ALIAS_EQUALS", "Y");
            }
            parms.put("auditUserAlias", example.getAuditUserAlias());
            break;
        case RptInstanceExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_USER_ALIAS_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_AUDIT_USER_ALIAS_NOT_EQUALS", "Y");
            }
            parms.put("auditUserAlias", example.getAuditUserAlias());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_USER_ALIAS_GT", "Y");
            } else {
                parms.put("AND_AUDIT_USER_ALIAS_GT", "Y");
            }
            parms.put("auditUserAlias", example.getAuditUserAlias());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_USER_ALIAS_GE", "Y");
            } else {
                parms.put("AND_AUDIT_USER_ALIAS_GE", "Y");
            }
            parms.put("auditUserAlias", example.getAuditUserAlias());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_USER_ALIAS_LT", "Y");
            } else {
                parms.put("AND_AUDIT_USER_ALIAS_LT", "Y");
            }
            parms.put("auditUserAlias", example.getAuditUserAlias());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_USER_ALIAS_LE", "Y");
            } else {
                parms.put("AND_AUDIT_USER_ALIAS_LE", "Y");
            }
            parms.put("auditUserAlias", example.getAuditUserAlias());
            break;
        case RptInstanceExample.EXAMPLE_LIKE:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_USER_ALIAS_LIKE", "Y");
            } else {
                parms.put("AND_AUDIT_USER_ALIAS_LIKE", "Y");
            }
            parms.put("auditUserAlias", example.getAuditUserAlias());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getAUDIT_MSGExampleParms(RptInstanceExample example) {
        Map parms = new HashMap();
        switch (example.getAuditMsg_Indicator()) {
        case RptInstanceExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_MSG_NULL", "Y");
            } else {
                parms.put("AND_AUDIT_MSG_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_MSG_NOT_NULL", "Y");
            } else {
                parms.put("AND_AUDIT_MSG_NOT_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_MSG_EQUALS", "Y");
            } else {
                parms.put("AND_AUDIT_MSG_EQUALS", "Y");
            }
            parms.put("auditMsg", example.getAuditMsg());
            break;
        case RptInstanceExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_MSG_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_AUDIT_MSG_NOT_EQUALS", "Y");
            }
            parms.put("auditMsg", example.getAuditMsg());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_MSG_GT", "Y");
            } else {
                parms.put("AND_AUDIT_MSG_GT", "Y");
            }
            parms.put("auditMsg", example.getAuditMsg());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_MSG_GE", "Y");
            } else {
                parms.put("AND_AUDIT_MSG_GE", "Y");
            }
            parms.put("auditMsg", example.getAuditMsg());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_MSG_LT", "Y");
            } else {
                parms.put("AND_AUDIT_MSG_LT", "Y");
            }
            parms.put("auditMsg", example.getAuditMsg());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_MSG_LE", "Y");
            } else {
                parms.put("AND_AUDIT_MSG_LE", "Y");
            }
            parms.put("auditMsg", example.getAuditMsg());
            break;
        case RptInstanceExample.EXAMPLE_LIKE:
            if (example.isCombineTypeOr()) {
                parms.put("OR_AUDIT_MSG_LIKE", "Y");
            } else {
                parms.put("AND_AUDIT_MSG_LIKE", "Y");
            }
            parms.put("auditMsg", example.getAuditMsg());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getLOCKEDExampleParms(RptInstanceExample example) {
        Map parms = new HashMap();
        switch (example.getLocked_Indicator()) {
        case RptInstanceExample.EXAMPLE_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_LOCKED_NULL", "Y");
            } else {
                parms.put("AND_LOCKED_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_NOT_NULL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_LOCKED_NOT_NULL", "Y");
            } else {
                parms.put("AND_LOCKED_NOT_NULL", "Y");
            }
            break;
        case RptInstanceExample.EXAMPLE_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_LOCKED_EQUALS", "Y");
            } else {
                parms.put("AND_LOCKED_EQUALS", "Y");
            }
            parms.put("locked", example.getLocked());
            break;
        case RptInstanceExample.EXAMPLE_NOT_EQUALS:
            if (example.isCombineTypeOr()) {
                parms.put("OR_LOCKED_NOT_EQUALS", "Y");
            } else {
                parms.put("AND_LOCKED_NOT_EQUALS", "Y");
            }
            parms.put("locked", example.getLocked());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_LOCKED_GT", "Y");
            } else {
                parms.put("AND_LOCKED_GT", "Y");
            }
            parms.put("locked", example.getLocked());
            break;
        case RptInstanceExample.EXAMPLE_GREATER_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_LOCKED_GE", "Y");
            } else {
                parms.put("AND_LOCKED_GE", "Y");
            }
            parms.put("locked", example.getLocked());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN:
            if (example.isCombineTypeOr()) {
                parms.put("OR_LOCKED_LT", "Y");
            } else {
                parms.put("AND_LOCKED_LT", "Y");
            }
            parms.put("locked", example.getLocked());
            break;
        case RptInstanceExample.EXAMPLE_LESS_THAN_OR_EQUAL:
            if (example.isCombineTypeOr()) {
                parms.put("OR_LOCKED_LE", "Y");
            } else {
                parms.put("AND_LOCKED_LE", "Y");
            }
            parms.put("locked", example.getLocked());
            break;
        }
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    private Map getExampleParms(RptInstanceExample example) {
        Map parms = new HashMap();
        parms.putAll(getIDExampleParms(example));
        parms.putAll(getRPT_CODEExampleParms(example));
        parms.putAll(getORG_CODEExampleParms(example));
        parms.putAll(getRPT_DATEExampleParms(example));
        parms.putAll(getRPT_STATUSExampleParms(example));
        parms.putAll(getAUDIT_STATUSExampleParms(example));
        parms.putAll(getAUDIT_DATEExampleParms(example));
        parms.putAll(getAUDIT_USER_NAMEExampleParms(example));
        parms.putAll(getAUDIT_USER_ALIASExampleParms(example));
        parms.putAll(getAUDIT_MSGExampleParms(example));
        parms.putAll(getLOCKEDExampleParms(example));
        return parms;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public int selectCountByExample(RptInstanceExample example) {
        Map parms = getExampleParms(example);
        int count = ((Integer)getSqlMapClientTemplate().queryForObject("rpt_instance.abatorgenerated_selectCountByExample", parms)).intValue();
        return count;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public PageBox selectByExampleWithPaging(RptInstanceExample example, int pageSize, int pageNum, String orderByClause) {
        Map parms = getExampleParms(example);
        if (orderByClause != null) {
            parms.put("ABATOR_ORDER_BY_CLAUSE", orderByClause);
        }
        PageBox pageBox = new PageBox();
        PageObject pageObject = new PageObject();
        pageObject.setPageSize(pageSize);
        pageObject.setPageIndex(pageNum);
        int itemAmount = selectCountByExample(example);
        pageObject.setItemAmount(itemAmount);
        List pageList = null;
        if (pageObject.getBeginIndex() <= pageObject.getItemAmount()) {
            pageList = (getSqlMapClientTemplate().queryForList("rpt_instance.abatorgenerated_selectByExample", parms, pageObject.getBeginIndex() - 1, pageSize));
        }
        pageBox.setPageObject(pageObject);
        pageBox.setPageList(pageList);
        return pageBox;
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public PageBox selectByExampleWithPaging(RptInstanceExample example, int pageSize, int pageNum) {
        return selectByExampleWithPaging(example, pageSize, pageNum, null);
    }

    /**
     * This method was generated by Abator for iBATIS.
     * This method corresponds to the database table rpt_instance
     *
     * @abatorgenerated Tue Sep 20 22:24:44 CST 2011
     */
    public int updateByPrimaryKeyForCgs(RptInstance record) {
        int rows = getSqlMapClientTemplate().update("rpt_instance.abatorgenerated_updateByPrimaryKeyForCgs", record);
        return rows;
    }
}